#!/bin/bash
clear
if [[ "$EUID" -ne 0 ]]; then
  echo -e "\033[1;31m Anda tiada kebenaran untuk menjalankan skrip ini! \033[0m"; exit 1
fi

if [[ ! -d /usr/local/plugins ]]; then
  mkdir /usr/local/plugins
fi

wget -q -O /usr/local/bin/menu 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/menu'
chmod +x /usr/local/bin/menu

# dropbear & openvpn
wget -q -O /usr/local/plugins/trial.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/trial_acc.sh'
wget -q -O /usr/local/plugins/create.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/add_acc.sh'
wget -q -O /usr/local/plugins/renew.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/renew_acc.sh'
wget -q -O /usr/local/plugins/lists.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/lists_acc.sh'
wget -q -O /usr/local/plugins/login.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/login_acc.sh'
wget -q -O /usr/local/plugins/lock.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/lock_acc.sh'
wget -q -O /usr/local/plugins/unlock.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/unlock_acc.sh'
wget -q -O /usr/local/plugins/delete.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sshd/delete_acc.sh'

# shadowsocks-libev
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/add_libev.sh'
wget -q -O /usr/local/plugins/renew-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/renew_libev.sh'
wget -q -O /usr/local/plugins/lists-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/lists_libev.sh'
wget -q -O /usr/local/plugins/disable-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/disable_libev.sh'
wget -q -O /usr/local/plugins/enable-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/enable_libev.sh'
wget -q -O /usr/local/plugins/delete-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/sslibev/delete_libev.sh'

# v2ray
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/add_trojan.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/renew_trojan.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/lists_trojan.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/delete_trojan.sh'

wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/add_vless.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/renew_vless.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/lists_vless.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/delete_vless.sh'

wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/add_vmess.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/renew_vmess.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/lists_vmess.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/v2ray/delete_vmess.sh'

# xray
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/xray/add_xray.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/xray/renew_xray.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/xray/lists_xray.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/xray/delete_xray.sh'

# wireguard
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/wireguard/add_wg.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/wireguard/renew_wg.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/wireguard/lists_wg.sh'
wget -q -O /usr/local/plugins/add-ss.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/wireguard/delete_wg.sh'

# services
wget -q -O /usr/local/plugins/dropbear.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/dropbear.sh'
wget -q -O /usr/local/plugins/openvpn.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/openvpn.sh'
wget -q -O /usr/local/plugins/shadowsocks.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/shadowsocks.sh'
wget -q -O /usr/local/plugins/v2ray.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/v2ray.sh'
wget -q -O /usr/local/plugins/xray.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/xray.sh'
wget -q -O /usr/local/plugins/wireguard.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/wireguard.sh'
wget -q -O /usr/local/plugins/websocket.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/websocket.sh'
wget -q -O /usr/local/plugins/squid.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/squid.sh'
wget -q -O /usr/local/plugins/stunnel.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/service/stunnel.sh'

# server
wget -q -O /usr/local/plugins/detail.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/server/detail.sh'
wget -q -O /usr/local/plugins/tcpbbr.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/server/tcpbbr.sh'
wget -q -O /usr/local/plugins/wondershaper.sh 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/server/wondershaper.sh'
wget -q -O /usr/local/bin/speedtest 'https://raw.githubusercontent.com/cybertize/debian/buster/plugins/server/speedtest_cli.py'
chmod +x /usr/local/bin/speedtest

echo
echo -e "\033[1;32m Pemasangan menus plugins telah selesai. \033[0m"
echo
